home *** CD-ROM | disk | FTP | other *** search
- /* process_gif.h
- * AUTHOR: Cy Booker, cy@cheepnis.demon.co.uk
- * LICENSE: FreeWare, Copyright (c) 1995 Cy Booker
- * PURPOSE: process an 8 bit image into another image `inline'
- * ie overwrite the source with the destination on a row-by row basis
- * obviously this means that if going 8 -> 16/32 bit then each row
- * needs to be wide enough, and we have to process right -> left
- */
-
- #ifndef process_gif_h
- #define process_gif_h
-
- #include "OS:os.h"
-
-
-
- /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- */
-
- typedef struct fixedpalette fixedpalette;
-
- struct fixedpalette {
- os_colour *colours; /* ncolours entries */
- int ncolours;
- };
-
-
-
- /*
- * holds a 48-bit colour specified in RGB space
- * the number (when normalised) holds values 0 (no intensity) to 0xffff (full intensity)
- */
-
- typedef struct rgbtuple rgbtuple;
-
- struct rgbtuple {
- int red;
- int grn;
- int blu;
- };
-
-
-
- typedef struct fixedrgbtuples fixedrgbtuples;
-
- struct fixedrgbtuples {
- rgbtuple *colours; /* ncolours entries */
- int ncolours;
- };
-
-
-
- /*
- * this structure is used when processing images, the output palette is not used for
- * processing to 16bpp images
- */
-
- typedef struct rgbtupleout rgbtupleout;
-
- struct rgbtupleout {
- rgbtuple colour;
- fixedrgbtuples palette; /* destination palette, if <= 256 colours */
- };
-
-
-
- typedef bits (*rgbtupleout_fn)(rgbtupleout *, int, int, int);
-
-
- typedef struct process_gif process_gif;
-
- struct process_gif {
- byte *buffer; /* i/o (must be word-aligned) */
- int pixel_width; /* > 0 */
- int pixel_height; /* > 0 */
- int line_length; /* must be word-aligned for some processing */
- fixedpalette in_palette; /* only used by some routines */
- fixedrgbtuples out_palette; /* only used when outputting 8bpp images */
- rgbtupleout_fn fn;
- };
-
-
-
- /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- *
- * this uses the in_palette, and fn members to calculate a mapping from input colour to
- * output colour number
- * the fn may use the out_palette member (particularly if output to <= 256 colours)
- *
- */
-
-
- extern void process_gif_calc_pixtrans(
- const process_gif *p,
- bits *pixtrans);
-
-
-
- #endif /* process_gif_h */
-